extends Control

## 结论，godot的控制台最多可以输出161000行。单次最多输出32573个字符（汉字、英文均可）。

const FILE_NAME: String = "user://output_limitation.log"
const CONTENT_LINE: String = "abcdefghij"
@export var max_lines: int = 1000_000##_000_000_000
@export var max_chars: int = 32_573

# Called when the node enters the scene tree for the first time.
func _ready() ->void:
	##test_lines()
	test_large_string(max_chars)

func test_large_string(chars: int) -> void:
	var s: String = "汪".repeat(chars)
	print(s)
	write_file(FILE_NAME, "{0}\t最多打印{1}个字符。".format([ Time.get_datetime_string_from_system(), s.length() ]))
	
	
func write_file(file_name: String, message: String) -> void:
	var file: FileAccess = FileAccess.open(file_name, FileAccess.WRITE)
	file.store_string(message)
	file.close()

func test_lines() -> void:
	for line in max_lines:
		print("{0}\t最多打印{1}行。".format([ Time.get_datetime_string_from_system(), line ]))
